/*
 * graph2D
 * Copyright (c) 2009 Shun Moriya <shun@mnu.sakura.ne.jp>
 *
 * The MIT License
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
 * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

#if !defined(___GRAPH2D_COMMON_H___)
#define ___GRAPH2D_COMMON_H___

#include <cassert>

#if !defined(DISALLOW_COPY_AND_ASSIGN)
#define DISALLOW_COPY_AND_ASSIGN(TypeName)	\
TypeName(const TypeName&);					\
void operator=(const TypeName&)
#endif

#if !defined(TARGET_DETECTED)
 #define TARGET_DETECTED
 #if defined(_WIN32) || defined(_WIN64)
  #define TARGET_WINDOWS
 #elif defined(__APPLE__)
  #define TARGET_APPLE
  #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
   #define TARGET_IPHONE
  #elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
   #define TARGET_MAC_OSX
  #else
   #error Unknown platform.
  #endif
 #else
  #error Platform Not Supported.
 #endif
#endif

#if (defined(DEBUG) || defined(_DEBUG) || defined(_DEBUG_)) || !defined(NDEBUG)
/*
 * 0 ... no log
 * 1 ... trigger on event
 * 2 ... update on event
 * 3 ... every update (debug for critical bugs)
 */
#define GRAPH2D_LOG_DETAIL_LEVEL	0
#else
#define GRAPH2D_LOG_DETAIL_LEVEL	0
#endif

namespace Graph2D
{
	////////////////////////////////////////////////////////////////////////////////////////////////
	/*!
	 * 更新情報
	 */
	typedef struct UpdateInfomation
	{
		/*!
		 * 進んだカレント時間
		 */
		float deltaTime;

		/*!
		 * ベースとなるFPSで割った値。処理落ちがなければ1.0が入る。
		 * 例 等速=1.0f, 倍速 = 0.5f, ベース60fpsから30fpsに落ちる(2.0)になる
		 */
		float stepCount;
	}UpdateInfomation;
}

#endif
